<template>
  <view class="section">
    <view class="title">{{ title }}</view>
    <view class="arrow-box" @click="onArrowClick">
      <text>{{ arrowText }}</text>
      <fui-icon :size="35" :name="iconName"></fui-icon>
    </view>
  </view>
</template>

<script setup>

// 接收props
const props = defineProps({
  title: {
    type: String,
    required: true,
    default: ''
  },
  arrowText: {
    type: String,
    default: '查看更多'
  },
  iconName: {
    type: String,
    default: 'arrowright'
  }
})

// 发出自定义事件
const emit = defineEmits(['arrow-click'])

// 处理箭头点击事件
const onArrowClick = () => {
  emit('arrow-click');
};
</script>


<style scoped lang="scss">
.section {
  width: 100%;
  height: 120rpx;
  display: flex;
  align-items: center;
  justify-content: space-between;

  .title {
    color: #000000;
    font-size: 32rpx;
  }

  .arrow-box {
    height: 34rpx;
    width: 132rpx;
    color: #666666;
    font-size: 24rpx;
    display: flex;
    align-items: center;
    justify-content: space-evenly;
  }
}
</style>
